#include <memory>
#include <signal.h>
#include "tcp_server.hpp"
#include "calculator.hpp"
#include "epoll_conn.hpp"

// Calc是传给tcp服务器的上层业务接口
void Calc(std::shared_ptr<Link> link_ptr)
{
    Calculator calc(link_ptr);
    calc.AnalyseReq();
    calc.Calculate();
    calc.PackageRsp();
}


int main()
{
    std::unique_ptr<TcpServer> svr_p(new TcpServer("0.0.0.0", 8080, Calc));
    svr_p->Init();
    svr_p->Loop();
    return 0;
}